Fix detection of OpenGL 3.3 core GL_ARB_timer_query.
authorDavid Hogan <david.q.hogan@gmail.com>
Wed, 12 Feb 2020 20:55:59 +0000 (07:55 +1100)
committerDavid Hogan <david.q.hogan@gmail.com>
Thu, 13 Feb 2020 18:41:01 +0000 (05:41 +1100)
Some systems (notably macOS) will not allow enumeration of an extension that has been promoted to core OpenGL for context in use. This change assumes that GL_ARB_timer_query is available on OpenGL 3.3+.

I could not find definitive information on whether GL_ARB_debug_output or GL_KHR_debug have been added to core. Other extensions in use were addressed by https://gitlab.gnome.org/GNOME/gtk/merge_requests/1422 .

gsk/gl/gskglprofiler.c

index 95f5a794a52175368268a1b7ab38cd3fd1c167f2..0262bd20f8272f4bce9949beb677bb10209fcb77 100644 (file)
@@ -109,7 +109,7 @@ gsk_gl_profiler_init (GskGLProfiler *self)
   glGenQueries (N_QUERIES, self->gl_queries);
 
   self->first_frame = TRUE;
-  self->has_timer = epoxy_has_gl_extension ("GL_ARB_timer_query");
+  self->has_timer = epoxy_gl_version () >= 33 || epoxy_has_gl_extension ("GL_ARB_timer_query");
 }
 
 GskGLProfiler *